#INC=-I/usr/local/include/
INC=-I$(shell llvm-config --includedir)
all: liveness.so available.so

CXXFLAGS = -rdynamic $(shell llvm-config --cxxflags) $(INC) -g -O0 -fPIC -fno-omit-frame-pointer

LDFLAGS = $(shell llvm-config --cxxflags --ldflags --libs --system-libs) -shared

dataflow.o: dataflow.cpp dataflow.h

available-support.o: available-support.cpp available-support.h	

%.so: %.o dataflow.o available-support.o
	clang++ -dylib -shared $^ -o $@ -g

available.so: available.o dataflow.o available-support.o
	$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)

liveness.so: liveness.o dataflow.o available-support.o
	$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)

clean:
	rm -f *.o *~ *.so

.PHONY: clean all
